package org.example06;

import org.example06.ba01.SomeService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest01 {
    @Test
    public void test01(){
        String config = "applicationContext.xml";

        ApplicationContext ac =new ClassPathXmlApplicationContext(config);
        SomeService proxy = (SomeService) ac.getBean("someService");
        //通过代理的对象执行方法，实现目标方法执行时，增强了功能
        //proxy:com.sun.proxy.$Proxy10 动态代理实现
        System.out.println("proxy:"+proxy.getClass().getName());
        proxy.doSome("list", 20);

    }
}
